package creation.factory.simaple;

public class OrderPizza {

    Pizza getPizza(String name){
        Pizza pizza = null;
        switch (name){
            case "chess":
                pizza = new ChessPizza();
                break;
            case "greek":
                pizza = new GreekPizza();
                break;
        }
        if(pizza != null){
            pizza.prepare();
            pizza.baker();
            pizza.cut();
            pizza.box();
        }
        return pizza;
    }
}
